package lin.an.food.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lin.an.food.entity.Food;
import lin.an.food.vo.FoodDetailsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zhoulinq
 * @date 2025/3/18
 */
public interface FoodMapper extends BaseMapper<Food> {
    FoodDetailsVo details(Integer foodId);
    
    /**
     * 获取指定用户收藏的美食ID列表
     * @param userId 用户ID
     * @return 美食ID列表
     */
    @Select("SELECT food_id FROM food_favorite WHERE user_id = #{userId}")
    List<Integer> getUserFavoriteFoodIds(@Param("userId") Integer userId);
}
